﻿@using Sausage.Web.Models
@using Sausage.Web.DataModel
@using Telerik.Web.Mvc.UI
@model DictionaryItemListRow
@{
    ViewBag.Title = "养护计划填报";
    Layout = "~/Views/Shared/MainLayout.cshtml";

    //用于保存项目类型信息
    List<string> categoryModels = new List<string>();

    //查询项目类型信息
    using (SausageEntities entities = new SausageEntities())
    {
        //查询所有养护类型信息
        foreach (MaintainCategory item in entities.MaintainCategory.Where(item => item.IsLeaf).OrderBy(item => item.CategoryPinYin).ToArray())
        {
            //转换为字符串
            categoryModels.Add(string.Format(@"{{ ID: '{0}', Name: '{1} {2}', Unit:'{3}' }}", item.CategoryID, item.CategoryPinYin, item.CategoryName, item.Unit));
        }
    }      
}
@section HeadCssLink
{
    <link href="@Url.Content("~/Content/Styles/ext-patch.css")" rel="stylesheet" type="text/css" />
}
@section HeadScriptLink
{
    <script src="@Url.Content("~/Scripts/ExtJS/locale/ext-lang-zh_CN.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/model.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Sausage/MaintainPlan/Submit.js")" type="text/javascript"></script>
    <script type="text/javascript">
        //用于保存养护类型信息
        var master_category =
        [
            @Html.Raw(System.String.Join(",", categoryModels))
        ];

        //用于保存养护类型存储
        var store_master_category = null;
    </script>
}
<h2>
    @ViewBag.Title
</h2>
<br />
<div id="data-grid" class="div-grid-box">
</div>
